# Maintainer: Jonathan Steel <jsteel at archlinux.org>
# Contributor: yugrotavele <yugrotavele at archlinux dot us>
# Contributor: Varun Acharya <varun@archlinux.org>
# Contributor: Nicolai Lissner <nlissne@linux01.gwdg.de>

pkgname=dvdbackup
pkgver=0.4.2
pkgrel=6
pkgdesc="Tool to rip video DVDs from the command line"
arch=('loong64' 'x86_64')
url="https://dvdbackup.sourceforge.net"
license=('GPL3')
depends=('libdvdread')
optdepends=('libdvdcss: to decrypt encrypted DVDs')
source=(https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.xz
        dvdbackup-dvdread-6.1.patch)
sha512sums=('df9abb2ca0b8a7cd7855ddff94dae249b06b2ec0ee42f3e9c53aa46aebd9885bdf26dacecbd4a20ff5f642ea10c0c64b811d25c23802c8a2b1489281900fbe0d'
            '3cdbf37b89c9723bff4212e994e194c4da62c9509cadccb47a63eb423675152e7f7fabf866225beef8e6831ac33365648eeccd737c6c54cf211dd354aacd2382')

prepare() {
  cd $pkgname-$pkgver
  
# fix build with libdvdread 6.1 https://bugs.launchpad.net/dvdbackup/+bug/1869226
  patch -p0 -i ../dvdbackup-dvdread-6.1.patch
}

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr

  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="$pkgdir" install
}
